<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<c:import url="/view/admin/include/header/adminHeader.jsp"></c:import>
    <!-- 컨텐츠 부분 -->
	<div id="container">
    	<!-- 왼쪽 메뉴 부분 -->
    	<c:import url="/view/admin/include/left/adminLeft.jsp"></c:import>
        <!-- 왼쪽 메뉴 부분 -->
        <!-- 오른쪽 내용 부분 -->
        <dl>
        	<dd class="path">
        		홈 > 게시판 관리 > 
        		<span class="path_b">
        			소송진행 현황
        		</span>
        	</dd>
        </dl>
		<form id="searchForm" action="/admin/caseList.hcom" method="post" enctype="multipart/form-data">
			<input type="hidden" id="currentPage" name="currentPage" value="${boardBean.currentPage }" />  
			<input type="hidden" id="open_flag" name="open_flag" value="${boardBean.open_flag}" /> 
			<input type="hidden" id="status_flag" name="status_flag" value="${boardBean.status_flag}" /> 
			<input type="hidden" id="sue_flag" name="sue_flag" value="${boardBean.sue_flag}" />    
	        <dl class="board_top">
	            <dd class="result_num f_orange">검색결과  : 총 ${totalCount}건</dd>
	            </dl>
	            <dl class="board_top">
	            <dd class="top_line_list">부서명:
	            	<select id="search" name="search">
	            			<option value="all">전체</option>
							<option value="EL31">경리부</option>
							<option value="EL28">경영지원부</option>
							<option value="EL17">고객지원1부</option>
							<option value="EL18">고객지원2부</option>
							<option value="EL22">구매부</option>
							<option value="EL26">기계개발부</option>
							<option value="EL05">기술영업부</option>
							<option value="EL33">기획관리부</option>
							<option value="EL47">나웅산전</option>
							<option value="EL19">리모델링영업부</option>
							<option value="EL34">마케팅부</option>
							<option value="EL40">미래ESP</option>
							<option value="EL38">브라질법인</option>
							<option value="EL42">상성산업</option>
							<option value="EL39">상해법인</option>
							<option value="EL21">생산부</option>
							<option value="EL15">서비스관리부</option>
							<option value="EL16">서비스마케팅부</option>
							<option value="EL45">서진E/L</option>
							<option value="EL20">설계부</option>
							<option value="EL06">설치1부</option>
							<option value="EL07">설치2부</option>
							<option value="EL08">설치관리부</option>
							<option value="EL41">수영엘텍</option>
							<option value="EL48">신라산업</option>
							<option value="EL43">신성산기</option>
							<option value="EL49">알앤엠</option>
							<option value="EL02">영업1부</option>
							<option value="EL03">영업2부</option>
							<option value="EL04">영업3부</option>
							<option value="EL37">윤리경영부</option>
							<option value="EL44">이존산업</option>
							<option value="EL27">인재개발부</option>
							<option value="EL30">재정부</option>
							<option value="EL23">제조지원부</option>
							<option value="EL25">전기제어부</option>
							<option value="EL29">준법지원부</option>
							<option value="EL56">강원지사</option>
							<option value="EL60">경기지사</option>
							<option value="EL58">경남지사</option>
							<option value="EL53">광주지사</option>
							<option value="EL52">대구지사</option>
							<option value="EL54">대전지사</option>
							<option value="EL51">부산지사</option>
							<option value="EL57">울산지사</option>
							<option value="EL59">인천지사</option>
							<option value="EL55">전주지사</option>
							<option value="EL61">제주지사</option>
							<option value="EL50">토탈세일즈</option>
							<option value="EL35">품질관리부</option>
							<option value="EL32">해외법인관리부</option>
							<option value="EL13">해외영업 1부</option>
							<option value="EL14">해외영업 2부</option>
							<option value="EL36">효율개선부</option>
							<option value="EL46">E&P</option>
							<option value="EL24">IT응용기술부</option>
							<option value="EL09">MP설치부</option>
							<option value="EL11">S/S 개발</option>
							<option value="EL12">S/S 설치</option>
							<option value="EL10">S/S 영업</option>
			        </select>&nbsp;
			   		 제(피)소
			    	<select id="searchKeyword" name="searchKeyword">
	            		<option value="all">전체</option>
			         	<option value="1">제소</option>
	                    <option value="0">피소</option>
			        </select>&nbsp;
			        원고/피고
			        <select id="search_field" name="search_field">
				        <option value="all" <c:if test="${search_field == 'all' }">selected="selected"</c:if>>전체</option>
						<option value="plaintiff" <c:if test="${search_field == 'plaintiff' }">selected="selected"</c:if>>원고</option>
						<option value="defendant" <c:if test="${search_field == 'defendant' }">selected="selected"</c:if>>피고</option>
			        </select>&nbsp;
			        <input type="text" width="70" id="search_text" name="search_text" value="${search_text}"/>
	                <input type="button" value="검색" id="btnSearch" class="input_btn_search"/>&nbsp;
	                <img src="/images/admin/btn_excel_dn.gif" width="113" height="21" alt="엑셀 다운로드" id="excel" style="cursor:pointer" />
	            </dd>
	        </dl>
		</form>	           
        <dl class="content">          
            <dd class="">
            	<table cellspacing="0" cellpadding="0" summary="" >
                	<caption></caption>
                    	 <colgroup>
							<col width="7%;"/>
							<col width="12%;"/>
							<col width="16%;"/>
							<col width="11%;"/>
							<col width="10%;"/>
							<col width="10%;"/>
							<col width="7%;"/>
							<col width="7%;"/>
							<col width="7%;"/>
							<col width="10%;"/>
                         </colgroup>
                    <thead>
                    	<tr>
	                       	<th scope="col" class="table_th_bottom">프로젝트</th>
	                        <th scope="col" class="table_th_bottom">부서명</th>
	                        <th scope="col" class="table_th_bottom">사건번호</th>
	                        <th scope="col" class="table_th_bottom">사건명</th>
	                        <th scope="col" class="table_th_bottom">원고</th>
	                        <th scope="col" class="table_th_bottom">피고</th>
	                        <th scope="col" class="table_th_bottom">제(피)소</th>
	                        <th scope="col" class="table_th_bottom">상태</th>
	                        <th scope="col" class="table_th_bottom">공개여부</th>
	                        <th scope="col" class="table_th_bottom">기타</th>
                        </tr>
                    </thead>
                    <tbody>
                    	<s:if test="%{1 > list.size()}">
                    	<tr>
                    		<td colspan="10">게시물이 없습니다.</td>
                    	<tr>
                    	</s:if>
                    	<s:iterator value="list" status="i">
						<tr>
							<td style="text-align:left;">
									<c:choose>
		                           		<c:when test="${order_no.length() > 5}">
		                           			<span class="" title="${order_no}" >${order_no.substring(0,5)}...</span>
		                           		</c:when>
		                           		<c:otherwise>
		                           			${order_no }
		                           		</c:otherwise>
		                           </c:choose>
							<td style="text-align:left;">
							<c:choose>
								<c:when test="${mem_dept =='EL02'}">영업1부</c:when>
								<c:when test="${mem_dept =='EL03'}">영업2부</c:when>
								<c:when test="${mem_dept =='EL04'}">영업3부</c:when>
								<c:when test="${mem_dept =='EL05'}">기술영업부</c:when>
								<c:when test="${mem_dept =='EL06'}">설치1부</c:when>
								<c:when test="${mem_dept =='EL07'}">설치2부</c:when>
								<c:when test="${mem_dept =='EL08'}">설치관리부</c:when>
								<c:when test="${mem_dept =='EL09'}">MP설치부</c:when>
								<c:when test="${mem_dept =='EL10'}">S/S 영업</c:when>
								<c:when test="${mem_dept =='EL11'}">S/S 개발</c:when>
								<c:when test="${mem_dept =='EL12'}">S/S 설치</c:when>
								<c:when test="${mem_dept =='EL13'}">해외영업 1부</c:when>
								<c:when test="${mem_dept =='EL14'}">해외영업 2부</c:when>
								<c:when test="${mem_dept =='EL15'}">서비스관리부</c:when>
								<c:when test="${mem_dept =='EL16'}">서비스마케팅부</c:when>
								<c:when test="${mem_dept =='EL17'}">고객지원1부</c:when>
								<c:when test="${mem_dept =='EL18'}">고객지원2부</c:when>
								<c:when test="${mem_dept =='EL19'}">리모델링영업부</c:when>
								<c:when test="${mem_dept =='EL20'}">설계부</c:when>
								<c:when test="${mem_dept =='EL21'}">생산부</c:when>
								<c:when test="${mem_dept =='EL22'}">구매부</c:when>
								<c:when test="${mem_dept =='EL23'}">제조지원부</c:when>
								<c:when test="${mem_dept =='EL24'}">IT응용기술부</c:when>
								<c:when test="${mem_dept =='EL25'}">전기제어부</c:when>
								<c:when test="${mem_dept =='EL26'}">기계개발부</c:when>
								<c:when test="${mem_dept =='EL27'}">인재개발부</c:when>
								<c:when test="${mem_dept =='EL28'}">경영지원부</c:when>
								<c:when test="${mem_dept =='EL29'}">준법지원부</c:when>
								<c:when test="${mem_dept =='EL30'}">재정부</c:when>
								<c:when test="${mem_dept =='EL31'}">경리부</c:when>
								<c:when test="${mem_dept =='EL32'}">해외법인관리부</c:when>
								<c:when test="${mem_dept =='EL33'}">기획관리부</c:when>
								<c:when test="${mem_dept =='EL34'}">마케팅부</c:when>
								<c:when test="${mem_dept =='EL35'}">품질관리부</c:when>
								<c:when test="${mem_dept =='EL36'}">효율개선부</c:when>
								<c:when test="${mem_dept =='EL37'}">윤리경영부</c:when>
								<c:when test="${mem_dept =='EL38'}">브라질현대</c:when>
								<c:when test="${mem_dept =='EL39'}">상해법인</c:when>
								<c:when test="${mem_dept =='EL40'}">미래ESP</c:when>
								<c:when test="${mem_dept =='EL41'}">수영엘텍</c:when>
								<c:when test="${mem_dept =='EL42'}">상성산업</c:when>
								<c:when test="${mem_dept =='EL43'}">신성산기</c:when>
								<c:when test="${mem_dept =='EL44'}">이존산업</c:when>
								<c:when test="${mem_dept =='EL45'}">서진E/L</c:when>
								<c:when test="${mem_dept =='EL46'}">E&P</c:when>
								<c:when test="${mem_dept =='EL47'}">나웅산전</c:when>
								<c:when test="${mem_dept =='EL48'}">신라산업</c:when>
								<c:when test="${mem_dept =='EL49'}">알앤엠</c:when>
								<c:when test="${mem_dept =='EL50'}">토탈세일즈</c:when>
								<c:when test="${mem_dept =='EL51'}">부산지사</c:when>
								<c:when test="${mem_dept =='EL52'}">대구지사</c:when>
								<c:when test="${mem_dept =='EL53'}">광주지사</c:when>
								<c:when test="${mem_dept =='EL54'}">대전지사</c:when>
								<c:when test="${mem_dept =='EL55'}">전주지사</c:when>
								<c:when test="${mem_dept =='EL56'}">강원지사</c:when>
								<c:when test="${mem_dept =='EL57'}">울산지사</c:when>
								<c:when test="${mem_dept =='EL58'}">경남지사</c:when>
								<c:when test="${mem_dept =='EL59'}">인천지사</c:when>
								<c:when test="${mem_dept =='EL60'}">경기지사</c:when>
								<c:when test="${mem_dept =='EL61'}">제주지사</c:when>
							</c:choose>
		           			</td>
							<td style="text-align:left;">
							 <a href="/admin/caseDetail.hcom?case_seq=${case_seq}&mem_dept=${mem_dept}">
								<c:choose>
		                           		<c:when test="${case_no.length() > 17}">
		                           			<span class="" title="${case_no}" >${case_no.substring(0,17)}...</span>
		                           		</c:when>
		                           		<c:otherwise>
		                           			${case_no}
		                           		</c:otherwise>
		                           </c:choose>
		                           </a>
							</td>
							<td style="text-align:left;">
							<a href="/admin/caseDetail.hcom?case_seq=${case_seq}&mem_dept=${mem_dept}">
									<c:choose>
		                           		<c:when test="${case_name.length() > 8}">
		                           			<span class="" title="${case_name}" >${case_name.substring(0,8)}..
		                           			<c:if test="${flag == 'Y'}">
		                           			<img src="/images/admin/icon_new.gif">
		                           			</c:if>
		                           			</span>
		                           		</c:when>
		                           		<c:otherwise>
		                           			${case_name}
		                           			<c:if test="${flag == 'Y'}">
		                           			<img src="/images/admin/icon_new.gif" width="25" height="12" alt="new_icon" />
		                           			</c:if>
		                           		</c:otherwise>
		                           </c:choose>
		                           </a>
		                    </td>
							<td style="text-align:left;">
							<c:choose>
		                           		<c:when test="${plaintiff.length() > 5}">
		                           			<span class="" title="${plaintiff}" >${plaintiff.substring(0,5)}..</span>
		                           		</c:when>
		                           		<c:otherwise>
		                           			${plaintiff }
		                           		</c:otherwise>
		                           </c:choose>
							</td>
							<td style="text-align:left;">
							<c:choose>
		                           		<c:when test="${defendant.length() > 5}">
		                           			 <span class="" title="${defendant}" >${defendant.substring(0,5)}..</span>
		                           		</c:when>
		                           		<c:otherwise>
		                           			${defendant}
		                           		</c:otherwise>
		                           </c:choose>
							</td>
							<td>
							<c:choose>
		            			<c:when test="${sue_flag=='1'}">제소</c:when>
		            			<c:otherwise>피소</c:otherwise>
		           			</c:choose>
		           			</td>
							<td style="text-align:left;">
							<c:choose>
		            			<c:when test="${status_flag=='P'}"><img src="/images/admin/icon_ing.gif" alt="진행" width="49" height="16"/></c:when>
		            			<c:otherwise><img src="/images/common/btn_7.gif" alt="완료"/></c:otherwise>
		           			</c:choose>
		           			</td>
							<td>
							<c:choose>
		            			<c:when test="${open_flag=='N'}"><img src="/images/admin/icon_close.gif" alt="비공개" width="49" height="16"/></c:when>
		            			<c:otherwise><img src="/images/admin/icon_open.gif" alt="공개"/></c:otherwise>
		           			</c:choose>
		           			</td>
		           			<td style="text-align:left;">
							<c:choose>
		                           		<c:when test="${etc.length() > 10}">
		                           			 <span class="" title="${etc}" >${etc.substring(0,10)}..</span>
		                           		</c:when>
		                           		<c:otherwise>
		                           			${etc}
		                           		</c:otherwise>
		                           </c:choose>
							</td>
						</tr>
						</s:iterator>
                    </tbody>
                 </table>
            </dd>
        </dl>
        <dl class="paginate">
            <dd>
            	<div class="paginate_complex" >               
					<s:property value="boardBean.pagingStr" escape="false"/>             
               </div>
               <dd class="btn_right"><input type="button" value="쓰기" id="caseWrite" class="input_btn_s b" /></dd>
            </dd>
         </dl>
        <!-- 오른쪽 내용 부분 -->
    </div>
    <!-- 컨텐츠 부분 -->   
<c:import url="/view/admin/include/footer/adminFooter.jsp"></c:import>
<script type="text/javascript">
	$().ready(function(){
		$(".paginate_complex").children("span").click(function(){	
 			$("#pageIndex").val($(this).attr("id"));
 			$("#listForm").submit();
		});	
		
		$("#caseWrite").click(function(){
			location.href = "/admin/caseRegForm.hcom?";
		});

		$("#btnSearch").click(function(){ 
			if(searchValidate()){
				$("#searchForm").submit();	
			}
		});		
	});
	
	function searchValidate(){
		if($("#searchKeyword").val() == ""){
			alert("검색할 값을 넣어 주세요");
			$("#searchKeyword").focus();
			return false;
		}if($("#search_field").val() == ""){
			alert("검색할 값을 넣어 주세요");
			$("#search_field").focus();
			return false;
		}
		return true;
	}
	function movePage(page){
	$("#currentPage").val(page);
		/* alert($("#currentPage").val()); */
		location.href="/admin/caseList.hcom?board_code="+"&currentPage="+$("#currentPage").val();
	}
	
	
	$().ready(function(){		
		$("#excel").click(function(){			
			location.href = "/admin/caseLog.hcom";
		});
	});
</script>